package org.lookworld.mall.config;

import org.lookworld.mall.service.UmsResourceService;
import org.lookworld.mall.service.UmsAdminService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;

import javax.annotation.Resource;

@Configuration
public class MallSecurityConfig {
    @Resource
    private UmsAdminService adminService;
    @Resource
    private UmsResourceService resourceService;
    @Bean
    public UserDetailsService userDetailsService(){
        // 获取登陆用户信息
        return username -> adminService.loadUserByUsername(username);
    }
}
